package beanstao.util.store.database.interfaces;

import beanstao.util.id.Id;
import beanstao.util.log.ILog;
import beanstao.util.store.database.Columns;
import beanstao.util.store.database.Field;
import beanstao.util.store.database.Fields;
import beanstao.util.store.database.Where;
import beanstao.util.store.domainobject.Domain;


/**
 * 一个SQL语句生成器
 */
public interface ISqls extends ILog
{
	static String RECORD_COUNT = "recordCount";

	/**
	 * 添加数据库字段的Sql语句
	 */
	@Deprecated
	public String toAddTableFieldText(String tableName, Field field);

	public String toCreateText(final String storeName, final Domain domain);

	public String toUpdateText(final String storeName, final Domain domain);

	public String toUpdateText(final String storeName, final Domain domain, final Where subText);

	public String toDeleteText(final Fields fields, final Id modifiorId, final Where where);

	public String toDeleteText(String storeName, Domain domain);

	public String toRemoveText(final Domain domain);

	public String toRemoveText(final String storeName, final Id did);

	public String toRemoveText(final Fields fields, final Id modifiorId, final Where where);

	public String toExists(final String storeName, final Domain domain);

	public String toSelectSqlText(final String storeName, final Fields fields, final Columns columns, final Where where);

	public String toTopSelectSqlText(final String storeName, final Fields fields, final Columns columns, final Where where, final Integer top);

	public String toCountSelectSqlText(final String storeName, final Fields fields, final Where where);

	public String toPageSelectSqlText(final String storeName, final Fields fields, final Columns columns, final Where where, final Integer start, final Integer limit);
}
